﻿// Write a program that reads 3 integer numbers from the console and prints their sum.

using System;

class Read3Integers
{
    static void Main()
    {
        string str1 = Console.ReadLine();
        int number1;
        string str2 = Console.ReadLine();
        int number2;
        string str3 = Console.ReadLine();
        int number3;
        int sum = 0;

        if (int.TryParse(str1, out number1))
        {
            sum += number1;
        }
        else
        {
            Console.WriteLine("Your first number is invalid!");
        }

        if (int.TryParse(str2, out number2))
        {
            sum += number2;
        }
        else
        {
            Console.WriteLine("Your second number is invalid!");
        }

        if (int.TryParse(str3, out number3))
        {
            sum += number3;
        }
        else
        {
            Console.WriteLine("Your third number is invalid!");
        }

        Console.WriteLine("The sum is: " + sum);
        Console.WriteLine();

    }
}
